package com.yzt.dynamicmodule.view;

import android.content.Context;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.View;

import cn.jzvd.JZDataSource;
import cn.jzvd.JzvdStd;

/**
 * @Dscription: 隐藏全屏播放按钮
 */
public class CustomJZVD extends JzvdStd {

    public CustomJZVD(Context context) {
        super(context);
    }

    public CustomJZVD(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public void setUp(JZDataSource jzDataSource, int screen) {
        super.setUp(jzDataSource, screen);
        if (screen == SCREEN_NORMAL) {
            fullscreenButton.setVisibility(View.INVISIBLE);
        }
    }

    @Override
    public void setUp(String url, String title, int screen) {
        if (!TextUtils.isEmpty(url)) {
            url = url.replace("http://", "https://");
        }
        super.setUp(new JZDataSource(url, title), screen);
    }

    @Override
    public void init(Context context) {
        super.init(context);
        topContainer.setVisibility(GONE);
    }

    @Override
    public void setAllControlsVisiblity(int topCon, int bottomCon, int startBtn, int loadingPro, int posterImg, int bottomPro, int retryLayout) {
        super.setAllControlsVisiblity(topCon, bottomCon, startBtn, loadingPro, posterImg, bottomPro, retryLayout);
        topContainer.setVisibility(GONE);
    }
}
